# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jhkim

from coin.strategy.mm.base.feed_arb_base import (FeedArbSubscriberHandler, FeedArbSubsystem)
from coin.strategy.mm.subscription import SubscriptionRequest

from coin.exchange.gdax.ws.subscriber import GdaxSubscriber
from coin.strategy.mm.feed_arb import (GdaxFeedArbFlowBookBuilder)


class GdaxFeedArbSubscriberHandler(FeedArbSubscriberHandler):
  SubscriberType = GdaxSubscriber


class GdaxFeedArbSubsystem(FeedArbSubsystem):
  FlowBookBuilder = GdaxFeedArbFlowBookBuilder
  FeedSubscriber = GdaxFeedArbSubscriberHandler
  FeedSubReq = SubscriptionRequest('Spot', 'Gdax', None)

  def set_price_limit_error_callback(self, callback):
    self._price_limit_error_callback = callback
